module ApplicationHelper
	def hidden_div_if(condition, attributes = {}, &block)
    if condition
      attributes['style'] = 'display: none'
    end

    content_tag('div', attributes, &block)
  end

  def currency_to_locale(price)
    price=price*1.66 if 'cn' == I18n.locale.to_s
    # number_to_currency price
    number_to_currency(price, :locale => I18n.locale.to_s)
  end

  def payment_type_options
    options_for_select(Hash[Order::PAYMENT_TYPES.map{|x|[I18n.t('orders.payment_types.'+x.parameterize.underscore),x]}])
  end
end
